<script lang="ts" setup>
import useLotNews, { useLotNewsRefs } from "../hooks/useLotNews";
import NewsIt4 from "./NewsIt4.vue";
defineProps({
  resData: {
    type: Object,
    default: () => {}
  }
});
const { onLoad, onRefresh } = useLotNews();
const { chunkedNewsList, loading, finished, refreshing } = useLotNewsRefs();
</script>
<template>
  <div class="px-14 pt-17">
    <van-pull-refresh
      v-model="refreshing"
      @refresh="onRefresh"
      loosing-text="释放即可刷新..."
      loading-text="加载中..."
      pulling-text="下拉即可刷新..."
    >
      <van-list
        v-model:loading="loading"
        :finished="finished"
        @load="onLoad"
        :offset="300"
        finished-text="没有更多了"
        loading-text="加载中..."
      >
        <NewsIt4
          v-for="(item, index) in chunkedNewsList"
          :key="index"
          :item="item"
        />
      </van-list>
    </van-pull-refresh>
  </div>
</template>
